import { register } from "@antv/x6-vue-shape";
import ErTable from './ErTable.vue';
import ErTableSketch from './ErTableSketch.vue';


export function registerErTable() {
    register({
        shape: "er-table",
        width: 100,
        height: 100,
        component: ErTable,
        ports: {
            groups: {
                absolutePostion: {
                    markup: [
                        {
                            tagName: 'rect',
                            selector: 'portBody',
                        },
                    ],
                    attrs: {
                        portBody: {
                            width: 400,
                            height: 55,
                            strokeWidth: 1,
                            stroke: 'transparent',
                            // stroke: '#f00',
                            fill: 'transparent',
                            magnet: true,
                        },
                    },
                    position: {
                        name: "absolute",
                        args: { x: 0, y: 0 },
                    },
                },
            },
        },
    });
}

export function registerErTableSketch() {
    console.log("registerErTableSketch");
    register({
        shape: "er-table-sketch",
        width: 300,
        height: 50,
        component: ErTableSketch,
    });
}

export function registerAllErComponents() {
    registerErTable();
    registerErTableSketch();
}